package com.example;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.LinkedList;
import java.util.List;

public class App {

    public static final String REGEX = "\\s?第[一二三四五六七八九十百零]*章\\s?.*";
    public static int suffix = 1;
    public static final int interval = 50;
    public static File dir = new File("C:\\Users\\T470\\Desktop\\testDir");
    public static File file = new File("C:\\Users\\T470\\Desktop\\91174.txt");
    public static List<String> lines = new LinkedList<>();
    public static int count = 0;

    public static void main(String[] args) throws IOException {
        String url = "ftp://g:g@tv.kaida365.com:2166/正阳门下小女人%s.mp4";
        for (int i = 5; i < 49; i++) {
            String tmp = String.valueOf(i);
            if (tmp.length()<2){
                tmp="0"+tmp;
            }
            System.out.println(String.format(url, tmp));
        }
    }

    public static void write() {
        if (lines.size() > 0) {
            try {
                File file = new File(dir, (suffix ++) + ".txt");
                file.createNewFile();
                Files.write(file.toPath(),lines);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            lines = new LinkedList<>();
            count = 0 ;
        }
    }
}
